package ysc.cqnu.operdb.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ysc.cqnu.operdb.entity.ReceiveUserInfo;
import ysc.cqnu.operdb.entity.ResultData;
import ysc.cqnu.operdb.mapper.UserMapper;
import ysc.cqnu.operdb.service.UserUpdatePasswordFindService;

@Component
public class UserUpdatePasswordFindServiceImpl implements UserUpdatePasswordFindService {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private ResultData resultData;
    @Override
    public ResultData updatePassword(ReceiveUserInfo receiveLogin) {
        try{
            userMapper.updateValue(receiveLogin.getPassword(),receiveLogin.getName());
        }catch (Exception e){
            resultData.data=null;
            resultData.flag="ErrorDataBase";
            return resultData;
        }
        resultData.data=null;
        resultData.flag="updatesuccess";
        return resultData;
    }
}
